package cz.data.domain.metadata.service;

import cz.data.common.base.BaseResponse;
import cz.data.common.mybatis.BaseService;
import cz.data.common.support.db.core.DbColumn;
import cz.data.common.support.db.core.DbTable;
import com.aspose.words.Document;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cz.data.domain.metadata.model.dto.MetadataSourceDto;
import cz.data.domain.metadata.model.entity.MetadataSourceEntity;

import java.util.List;

public interface MetadataSourceService extends BaseService<MetadataSourceEntity> {

    void saveMetadataSource(MetadataSourceDto metadataSourceDto);

    void updateMetadataSource(MetadataSourceDto metadataSourceDto);

    MetadataSourceEntity getMetadataSourceById(String id);

    void deleteMetadataSourceById(String id);

    void deleteMetadataSourceBatch(List<String> ids);

    BaseResponse checkConnection(MetadataSourceDto metadataSourceDto);

    List<DbTable> getDbTables(String id);

    List<DbColumn> getDbTableColumns(String id, String tableName);

    void syncMetadata(String id);

    Document wordMetadata(String id) throws Exception;

    void refreshMetadata();

    List<MetadataSourceEntity> getMetadataSourceList();

    List<MetadataSourceEntity> getMetadataSourceSelectOptions(List<String> capability, String dbType);

    <E extends IPage<MetadataSourceEntity>> E pageWithAuth(E page, Wrapper<MetadataSourceEntity> queryWrapper);
}
